package snapex.user.service;

import org.springframework.security.core.userdetails.UsernameNotFoundException;

import snapex.core.SnapexApplicationException;
import snapex.core.model.User;

public interface IUserService {

	public User getByUsername(String username) throws UsernameNotFoundException;
	
	public User getByUserId(String userId) throws UsernameNotFoundException;
	
	public User getByHashKey(String hashKey) throws UsernameNotFoundException;
	
	public byte[] getCodeByHashKey(String hashKey) throws SnapexApplicationException;
	
	public String saveCodeByHashKey(String hashKey, byte[] data) throws SnapexApplicationException;
	
	public User getByOpenId(String openId) throws SnapexApplicationException;
	
//	public String registerWechat(User user) throws SnapexApplicationException;
	
	public String register(String hashUsername) throws SnapexApplicationException;
	
	public User registerWechatOpenId(String hashKey, String openId) throws SnapexApplicationException;
	
	public boolean logout(String username);
	
}
